#include "tp5Region.h"
#include "Point.h"

namespace Torch{

Region::Region()
{
	//au depart, tous les fils sont des feuilles
	this->m_fils1=0;
	this->m_fils2=0;
	this->m_fils3=0;
	this->m_fils4=0;
}

void Region::setCoordonne(int ix1,int iy1,int ix2,int iy2)
{
	
	//this->p1.intPoint(&(this->p1),ix1,iy1);
	//this->p2.initPoint(&(this->p2),ix2,iy2);	
	
	this->p1.setabs(ix1);
	//Point p(ix1,iy1);
	//Point q(ix2,iy2);
	//this->p1 = p;
	//this->p2 = q;
	//p1.abs = ix1;
	//p1.ord = iy1;
	//p2.abs = ix2;
	//p2.ord = iy2;
    	this->p1.setord(iy1);
   	this->p2.setabs(ix2);
    	this->p2.setord(iy2);
}

void Region::setParameter(int imu,int isigma,int inbpixel)
{
	this->m_iMu = imu;
	this->m_iSigma = isigma;
	this->m_iNbPixel = inbpixel;
}


void Region::getCoord(int *ix1,int *iy1,int *ix2,int *iy2)
{
	*ix1=(int)this->m_iX1;
	*ix2=(int)this->m_iX2;
	*iy1=(int)this->m_iY1;
	*iy2=(int)this->m_iY2;
}

void Region::getCoord(Point *p,Point *q)
{
	*p=this->p1;
	*q=this->p2;
} 	

void Region::getParameters(int *iMu,int *iSigma,int *iNbPixel)
{
	*iMu = this->m_iMu;
	*iSigma = this->m_iSigma;
	*iNbPixel = this->m_iNbPixel;	
}

void Region::setVoisin(vector<int>voisin)		
{
	m_Voisin.resize(voisin.size());
	
	for(int i=0;i<int(voisin.size());i++)
		m_Voisin[i]=voisin[i];

}

}


